#include "enermy.h"
#include "scene.h"


Enermy::Enermy()
{
    enermy_picture.load(":/images/enermy");
    //图片初始化
    enermy_x=0;
    enermy_y=0;
    //敌机坐标初始化
    enermy_situation=true;
    //默认敌机状态空闲
    enermy_speed=4;
    //设置敌机速度
    enermy_square.setWidth(enermy_picture.width());
    enermy_square.setHeight(enermy_picture.height());
    enermy_square.moveTo(enermy_x,enermy_y);
    //画出矩形边框，并移动到敌机所在位置
}

void Enermy::newenermy()
{
    if(enermy_situation==false){
        enermy_y+=enermy_speed;
        enermy_square.moveTo(enermy_x,enermy_y);
        //敌机移动
        if(enermy_y>= scene_height){
            enermy_situation=true;
        }
        //敌机位置超出屏幕后，将其设为空闲状态
    }
}
